import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Game extends JFrame {
	
	private static final int Rows = 8;
	private static final int Cols = 8;
	private static final int BaseScore = 100;
	private static final int NumJewels = 7;
	private static final int ChainLength = 3;
	private static final int JewelSize = 64;
	private static final int WindowBorderWidth = 16;
	private static final int WindowBorderHeight = 40;
	
	private static final long serialVersionUID = -1167870727317364825L;

	private BoardView boardView = null;
	
	public Game() {
		setTitle("Jewel");
		
		GameSettings gs = new GameSettings(Game.JewelSize, Game.Rows, Game.Cols, Game.NumJewels, this.BaseScore, Game.ChainLength);
		this.boardView = new BoardView(gs, new Board(gs));
		
		this.add(this.boardView);
		this.setSize(this.boardView.getWidth() + Game.WindowBorderWidth, this.boardView.getHeight() + Game.WindowBorderHeight);
		setLocationRelativeTo(null);
		
		setDefaultCloseOperation(EXIT_ON_CLOSE);
	}

	public static void main(final String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				Game game = new Game();
				game.setVisible(true);
			}
		});
	}
}